<template>
<div>user page
  <div>
    count:{{count}}
  </div>
  <button @click="addCount">count+1</button>
</div>
</template>
<script lang="ts">
import {defineComponent,computed} from 'vue'
import { useStore} from 'vuex'
export default defineComponent({
  name:'User',
  setup(){
    const $store = useStore()
    function addCount() {
      $store.dispatch('setCount',$store.state.count+1)
    }
    const count = computed(()=>{
      return $store.state.count
    })
    console.log(count.value)
    return {
      count,
      addCount
    }
  }
})
</script>
<style scoped>
</style>
